
//
//  UIImage++.swift
//  W_BAR_MAIN
//
//  Created by LC_WJH on 2017/10/24.
//  Copyright © 2017年 LC_WJH. All rights reserved.
//

import UIKit
import AFNetworking
let global_default_image =  UIImage.init(named: "default_food");

extension UIImageView {
    
    public func trySetURLString(_ str:String,failImage:UIImage)->Void/*succ*/{
        image = failImage;
        if !trySetURLString(str){
        }
    }
    
    //自动试错设置图片
    @discardableResult
    public func trySetURLString(_ str:String)->Bool/*succ*/{
        if let u =   URL.init(string: str) {
            self.setImageWith(u);
            return true;
        }
        return false;
    }
}
